<template>
    <div class="body_background" :style="GetWindowBackground">
        <div class="body_background">
            <ul class="order-list-box">
                <li v-for="(item,index) in goodsList" :key="item.id">
                    <div class="order-top-box second-color middle-font-size">
                        <div>入库单号:452445（总部直供/门店自采）</div>
                    </div>
                    <div class="order-content-box" @click="goDetailFun(item)">
                        <img :src="item.imgUrl"/>
                        <div class="order-info-box">
                            <div class="main-color big-font-size">商品名称</div>
                            <div class="goods-content">
                                <div>
                                    <div class="three-color small-font-size">分类：蔬菜</div>
                                    <div class="three-color small-font-size">规格：200g</div>
                                    <div class="three-color small-font-size">发货数：20</div>
                                    <div class="three-color small-font-size">入库单价：￥200</div>
                                </div>
                                <div class="light-color small-font-size goods-count">
                                    报损数量:<span class="font-size16 main-color">20</span>袋
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="all-goods-count main-color">共1件商品</div>
                    <div class="order-operation-box">
                        <div class="small-font-size main-color">入库时间：{{item.time}}</div>
                        <div class="small-font-size main-color">提交人：张三</div>
                    </div>
                </li>
            </ul>
            <div class="seize-seat light-color">-- 没有数据了 --</div>
        </div>
    </div>
</template>

<script>
    import {Toast} from 'mint-ui';

    export default {
        name: "WarehouseList",
        data() {
            return {
                GetWindowBackground: {
                    'min-height': ''
                },
                goodsList: [
                    {
                        id: 1,
                        title: "秘制小番茄500g",
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        num: 0,
                        time: '',
                        status: 2,//待审核
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }, {
                        id: 2,
                        title: "秘制小番茄500g",
                        spec: '500g/袋',
                        weight: '500g',
                        warehouse: '常温',
                        time: '2021-05-12 12:12:12',
                        num: 0,
                        status: 1,
                        imgUrl:
                            "https://t00img-c.yangkeduo.com/goods/images/2020-08-13/ce99a1b2f665ba478d9573c314686c5d.jpeg"
                    }
                ],
            }
        },
        methods: {
            //详情
            goDetailFun(item) {
                this.$router.push('/WarehouseDetail?id=' + item.id)
            },
            getHeight() {
                // 获取浏览器高度
                this.GetWindowBackground['min-height'] = window.innerHeight + 'px'
            },
        },
        // 生命周期 - 创建完成（可以访问当前this实例）
        created() {
            window.addEventListener('resize', this.getHeight) // 注册监听器
            this.getHeight() // 页面创建时先调用一次
        },
        // 生命周期 - 销毁完成
        destroyed() {
            window.removeEventListener('resize', this.getHeight)
        },
    }
</script>

<style lang="scss" scoped>

    .order-list-box {
        width: calc(100% - 20px);
        height: auto;
        margin: 10px 10px 0 10px;
        li {
            width: calc(100% - 30px);
            background: #fff;
            padding: 0 15px;
            margin-bottom: 10px;
            border-radius: 4px;
            .type {
                width: 100%;
                text-align: left;
                padding-bottom: 5px;
            }
            .order-top-box {
                width: 100%;
                height: 45px;
                display: flex;
                justify-content: space-between;
                align-items: center;
            }
            .order-content-box {
                width: 100%;
                display: flex;
                align-items: center;
                padding: 7px 0;
                img {
                    width: 80px;
                    height: 80px;
                    margin-right: 10px;
                    border-radius: 6px;
                }
                .goods-content {
                    width: 100%;
                    display: flex;
                    justify-content: space-between;
                }
                .order-info-box {
                    width: calc(100% - 70px);
                    display: flex;
                    flex-direction: column;
                    justify-content: space-between;
                    text-align: left;
                }
                .goods-count {
                    margin-left: auto;
                    margin-top: 10px;
                }
            }
            .all-goods-count {
                width: 100%;
                font-size: 13px;
                text-align: right;
                margin-bottom: 20px;
            }
            .order-operation-box {
                width: 100%;
                min-height: 40px;
                display: flex;
                align-items: center;
                justify-content: space-between;
                border-top: 1px dashed #D2D6DC;
                padding: 5px 0;
            }
            .order-item-price {
                width: 100%;
                display: block;
                text-align: right;
                margin-bottom: 10px;
            }

        }
    }

    .mint-button--primary.is-plain {
        border: 1px solid #b1b5d9;
        background-color: transparent;
        color: #b1b5d9;
        margin-left: 8px;
    }

    .mint-button--small {
        display: inline-block;
        padding: 0 10px;
        height: 26px;
    }

</style>